﻿using Auto.IRepository;
using Auto.IRepository.IRepositories;
using Auto.IService.IServices;
using Auto.Model;
using Auto.Model.Entities;
using Auto.Tools.Standards.ServiceResult;

using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace Auto.Service.Services
{
    public class AreaService : ServiceBase<Area>, IAreaService
    {
        public AreaService(IAreaRepository repository) : base(repository)
        {
            AreaRepository = repository;
        }

        public IAreaRepository AreaRepository { get; }

        /// <summary>
        /// 获取父级ID集合
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public List<int> GetAllAreaParentID(int ID, List<int> AreaIDs = null)
        {
            return AreaRepository.GetAllAreaParentID(ID, AreaIDs ?? new List<int>());
        }

        public Task<ServicePageDataResult<Area>> LoadPageDataListAsync2(Expression<Func<Area, bool>> whereLambda, Expression<Func<Area, object>> orderLambda, int pageIndex, int pageSize, bool isDesc = false)
        {
            throw new NotImplementedException();
        }
    }
}
